Setting up local NuGet feed

To reference NuGet-packages it’s necessary to publish them into NuGet feed. One of possible NuGet feeds is a local NuGet repository. To create a local repository, you need to do following steps:

  1. Create LocalPackages directory in repository of your project

  1. Copy NuGet packages to the LocalPackages folder

  2. Create NuGet.Config file in root directory of your project

  3. Put following value in Nuget.Config file:
    <?xml version="1.0" encoding="utf-8"?>

    <configuration>

    <packageSources>

    <add key="localPackages" value="LocalPackages" />

    </packageSources>

    </configuration>

  1. Run Visual Studio

  2. Open the project in which you need to reference NuGet-package

  3. Perform right mouse click on project in solution explorer and click ‘Manage NuGet packages’ in context menu

  4. Choose LocalPackages in Package source
    A picture containing text

Description automatically generated

  5. Search for necessary package and install.

Note: You can find more information about private NuGet feeds on https://docs.microsoft.com/en-us/nuget/hosting-packages/overview